﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Convertor
{
    /// <summary>
    /// Rename.xaml 的交互逻辑
    /// </summary>
    public partial class Rename : Window
    {
        private string toChangeName;

        public string ToChangeName
        {
            set { toChangeName = value; }
        }

        private string changedName;

        public string ChangedName
        {
            get { return changedName ?? toChangeName; }
        }
        public Rename()
        {
            InitializeComponent();
        }
        public Rename(string toChangeName)
            : this()
        {
            this.toChangeName = toChangeName;
        }

        private void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
            tbToChangeName.Text = toChangeName;
        }


        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            changedName = tbToChangeName.Text.Trim().Replace(" - 默认", "-默认");

            this.DialogResult = true;
            this.Close();
        }

    }
}
